// 库存接口

import { http } from '@/utils/http';




/* 获得产品库存分页 */
export const getProductPage = (params : any) => http({
  url: '/erp/product/page',
  params,
});

// 获取供应商选择列表
export const getAccountPage = (params : any) => http({
  url: '/erp/account/page',
  params,
});

// 获取供应商选择列表
export const getSupplierPage = (params : any) => http({
  url: '/erp/supplier/page',
  params,
});

// 获取客户选择列表
export const getCustomerPage = (params : any) => http({
  url: '/erp/customer/page',
  params,
});

// 获取用户选择列表
export const getUserPage = (params : any) => http({
  url: '/system/user/page',
  params,
});

// 获取工单选择列表
export const getWorkorderPage = (params : any) => http({
  url: '/mes/workorder/page',
  params,
});


  /* 获得采购订单分页 */
  export const updatePurchaseOrderStatus = (params : any) => http({
    url: '/erp/purchase-order/update-status',
    params,
	method: 'PUT',
  });

/* 获得采购订单分页 */
export const getPurchaseOrderInfo = (params : any) => http({
  url: '/erp/purchase-order/get',
  params,
});

export const getPurchaseOrderPage = (params : any) => http({
  url: '/erp/purchase-order/page',
  params,
});

// 新增采购订单
export const purchaseOrderCreate = (data : any) => http({
  url: '/erp/purchase-order/create',
  method: 'POST',
  data,
});

export const purchaseOrderUpdate = (data : any) => http({
  url: '/erp/purchase-order/update',
  method: 'PUT',
  data,
});

  export const updatePurchaseInStatus = (params : any) => http({
    url: '/erp/purchase-in/update-status',
    params,
	method: 'PUT',
  });

// 新增采购入库
export const purchaseInPage = (params : any) => http({
  url: '/erp/purchase-in/page',
  params,
});

export const purchaseInCreate = (data : any) => http({
  url: '/erp/purchase-in/create',
  method: 'POST',
  data,
});

export const purchaseInUpdate = (data : any) => http({
  url: '/erp/purchase-in/update',
  method: 'PUT',
  data,
});

export const purchaseInInfo = (params : any) => http({
  url: '/erp/purchase-in/get',
  params,
});

/* 获得销售订单分页 */
export const getSaleOrderPage = (params : any) => http({
  url: '/erp/sale-order/page',
  params,
});

// 新增销售订单
export const saleOrderCreate = (data : any) => http({
  url: '/erp/sale-order/create',
  method: 'POST',
  data,
});

export const saleOrderUpdate = (data : any) => http({
  url: '/erp/sale-order/update',
  method: 'POST',
  data,
});

export const saleOrderInfo = (params : any) => http({
  url: '/erp/sale-order/get',
  params,
});

export const saleOrderUpdateStatus = (params : any) => http({
  url: '/erp/sale-order/update-status',
  params,
  method: 'PUT',
});


// 新增销售出库
export const saleOutCreate = (data : any) => http({
  url: '/erp/sale-out/create',
  method: 'POST',
  data,
});

// 新增销售出库
export const saleOutUpdate = (data : any) => http({
  url: '/erp/sale-out/update',
  method: 'PUT',
  data,
});

export const saleOutInfo = (params : any) => http({
  url: '/erp/sale-out/get',
  params,
});

export const saleOutPage = (params : any) => http({
  url: '/erp/sale-out/page',
  params,
});

export const saleOutUpdateStatus = (params : any) => http({
  url: '/erp/sale-out/update-status',
  params,
  method: 'PUT',
});


// 新增销售退货
export const saleReturnCreate = (data : any) => http({
  url: '/erp/sale-return/create',
  method: 'POST',
  data,
});

// 新增销售退货
export const saleReturnUpdate = (data : any) => http({
  url: '/erp/sale-return/update',
  method: 'PUT',
  data,
});

export const saleReturnInfo = (params : any) => http({
  url: '/erp/sale-return/get',
  params,
});

export const saleReturnPage = (params : any) => http({
  url: '/erp/sale-return/page',
  params,
});
  export const updateSaleReturnStatus = (params : any) => http({
    url: '/erp/sale-return/update-status',
    params,
	method: 'PUT',
  });


  export const updatePurchaseOutStatus = (params : any) => http({
    url: '/erp/purchase-return/update-status',
    params,
	method: 'PUT',
  });

// 新增采购入库
export const purchaseOutPage = (params : any) => http({
  url: '/erp/purchase-return/page',
  params,
});

export const purchaseOutCreate = (data : any) => http({
  url: '/erp/purchase-return/create',
  method: 'POST',
  data,
});

export const purchaseOutUpdate = (data : any) => http({
  url: '/erp/purchase-return/update',
  method: 'PUT',
  data,
});

export const purchaseOutInfo = (params : any) => http({
  url: '/erp/purchase-return/get',
  params,
});



export const  getMesWorkorder = (params : any) => http({
  url: '/mes/workorder/get',
  params,
}); 

export const getProcessRoute = (params : any) => http({
  url: '/erp/product-process/listByProductIds',
  params,
});

export const getRouteProductListByRouteId = (params : any) => http({
  url: '/mes/route/route-process/list-by-route-id',
  params,
});


export const  delMesWorkorder = (params : any) => http({
  url: '/mes/workorder/delete',
  params,
  method: 'DELETE'
}); 